package com.xintonghua.bussiness.api.proxy;

import android.content.Context;
import android.widget.ImageView;

import com.xintonghua.bussiness.api.myinterface.MyImageLoader;
import com.xintonghua.bussiness.util.ImageTools;

import org.xutils.x;

import java.io.File;


/**
 * Created by Administrator on 2017/3/5.
 */

public class MyImageLoaderGlide implements MyImageLoader {
    private Context context;

    @Override
    public void displayImage(String imageUrl, ImageView imageView, int defaultImage) {

    }

    @Override
    public void displayRoundedImage(String imageUrl, ImageView imageView, int defaultImage) {
        x.image().bind(imageView, imageUrl, ImageTools.getRoundedOptions(defaultImage));
    }

    @Override
    public void displayCircleImage(String imageUrl, ImageView imageView, int defaultImage) {
        x.image().bind(imageView, imageUrl, ImageTools.getCircularOptions(defaultImage));
    }

    @Override
    public void displayCompleteUrl(String imageUrl, ImageView imageView, int defaultImage) {
        x.image().bind(imageView, imageUrl, ImageTools.getNotCircularOptions(defaultImage));
    }

    @Override
    public void displayRoundedCompleteUrl(String imageUrl, ImageView imageView, int defaultImage) {
        x.image().bind(imageView, imageUrl, ImageTools.getRoundedOptions(defaultImage));
    }

    @Override
    public void displayCircleCompleteUrl(String imageUrl, ImageView imageView, int defaultImage) {
        x.image().bind(imageView, imageUrl, ImageTools.getCircularOptions(defaultImage));
    }

    @Override
    public void displayFileImage(String imageUrl, ImageView imageView, int defaultImage) {
        x.image().bind(imageView, new File(imageUrl).toURI().toString(), ImageTools.getNotCircularOptions(defaultImage));
    }

    @Override
    public void displayRoundedFileImage(String imageUrl, ImageView imageView, int defaultImage) {
        x.image().bind(imageView, new File(imageUrl).toURI().toString(), ImageTools.getRoundedOptions(defaultImage));
    }

    @Override
    public void displayCircleFileImage(String imageUrl, ImageView imageView, int defaultImage) {
        x.image().bind(imageView, new File(imageUrl).toURI().toString(), ImageTools.getCircularOptions(defaultImage));
    }


}
